// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: false },
  modules: [
    // ...
    '@tdesign-vue-next/nuxt',
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt',
  ],

  //css
  css: [
    '~/assets/css/main.css',
    // '~/assets/css/tdesign.css',
  ],

  // plugins
  plugins: [
    {
      src: '~/plugins/wangeditor',
      mode: 'client'
    }
  ],

  build: {
    loaders: {
      css: {
        modules: true
      }
    }
  },

  // app
  app: {
    head: {
      bodyAttrs: {
        style: 'padding: 0px; margin: 0px;'
      }
    },
    pageTransition: { name: 'page', mode: 'out-in' },
    layoutTransition: { name: 'layout', mode: 'out-in' }
  },
  

  build: {
    transpile: ['tdesign-vue-next'],
  },
  // optimization: {
  //   minimize: true,
  //   minimizer: [
  //     // new CssMinimizerPlugin(),
  //   ],
  //   splitChunks: { // 生成 chunk 的最小体积（以 bytes 为单位）
  //     chunks: "all",
  //     automaticNameDelimiter: "-",
  //     maxSize: 102400,
  //     cacheGroups: {
  //       vendors: {
  //         test: /[\\/]node_modules[\\/]/,
  //         priority: -10, //优先级
  //         reuseExistingChunk: true,
  //       },
  //       common: {
  //         minChunks: 2,
  //         priority: -20, //优先级
  //         reuseExistingChunk: true,
  //       },
  //     },
  //   },
  // },
})
